unit equalizer;

interface
uses
{$IFNDEF FPC}
  Windows, XpMan,
{$ELSE}
  //LCS, LCL,
{$ENDIF}
  Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, StdCtrls;
const maxcnt = 5;
Type PtrackBar = ^TTrackbar;
type
  TEq = class(TForm)
    TrackBar1: TTrackBar;
    {$IFNDEF FPC}
    XPManifest1: TXPManifest;
    {$ENDIF}
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    TrackBar2: TTrackBar;
    Label4: TLabel;
    TrackBar3: TTrackBar;
    Label5: TLabel;
    TrackBar4: TTrackBar;
    Label6: TLabel;
    TrackBar5: TTrackBar;
    Label7: TLabel;
    procedure Button4Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure Button2Click(Sender: TObject);

  private
    { Private declarations }
    _eqs: array[0..maxcnt-1] of Ptrackbar;
  public
    { Public declarations }
  end;

var
  Eq: TEq;

implementation
{$IFNDEF FPC}
{$R *.dfm}
{$ELSE}
{$R *.lfm}
{$ENDIF}


procedure TEq.Button4Click(Sender: TObject);
begin
  eq.Hide;
end;

procedure TEq.Button3Click(Sender: TObject);
begin
  eq.Hide;
end;

procedure TEq.FormCreate(Sender: TObject);
begin
  _eqs[0] := @TrackBar1;
  _eqs[1] := @TrackBar2;
  _eqs[2] := @TrackBar3;
  _eqs[3] := @TrackBar4;
  _eqs[4] := @TrackBar5;
end;

procedure TEq.Button2Click(Sender: TObject);
var
  i: longint;
begin
  for i := 0 to maxcnt - 1 do
    _eqs[i]^.Position := 0;
end;

end.
